Changes the sprite effect playing on this object into another one over so many frames. A frozen tint turns into a burning one, a gentle wobble turns into a dizzy one. sprite_effect_change(nothing, frames) fades the effect away and then stops it; with no effect playing, the new one fades in. With frames at 0 it happens at once, like sprite_effect_start and sprite_effect_stop. Call it from the object’s own event, once.
Works differently on Game Boy - The Game Boy changes one sprite effect into another as the Game Boy Advance does: Tints are mixed, Scale and Rotate go part of the way each; what cannot be mixed fades out, then the next fades in.
Works differently on Game Boy Color - The Game Boy Color changes one sprite effect into another as the Game Boy Advance does: Tints are mixed, Scale and Rotate go part of the way each; what cannot be mixed fades out, then the next fades in.
Works differently on Sega Genesis - The Sega Genesis plays the Tint track of a sprite effect, so a change blends the Tints of the effects (the colors mixed by weight); the other tracks do not show here.
On other consoles this differs: see Side by side and How the consoles differ.
sprite_effect_change(effect, frames)| Name | Type |
|---|---|
effect | overlay |
frames | int |
Nothing.
Changes the sprite effect playing on this object into another one over so many frames. A frozen tint turns into a burning one, a gentle wobble turns into a dizzy one. sprite_effect_change(nothing, frames) fades the effect away and then stops it. If no effect is playing on the object, the new one fades in from nothing. With frames at 0 it happens at once, exactly like sprite_effect_start and sprite_effect_stop.
Call it once, from the object's own event. 60 frames are about a second.
A frozen object thawing into a burning one over two seconds:
sprite_effect_start(se_doc_frozen);
sprite_effect_change(se_doc_burning, 120);Fading the effect away over a second:
sprite_effect_change(nothing, 60);Both effects keep playing on their own clocks while they change.
sprite_effect_start and sprite_effect_stop.effect has to be a sprite effect. A text effect needs text_effect_change and a screen effect overlay_change.sprite_effect_strength and sprite_effect_speed set while a change is running belong to the effect that is leading.An object that is changing uses one of the 8 places sprite effects have, however many effects are on their way. A game that never calls sprite_effect_change has none of this in its cartridge.
Each effect keeps playing on its own clock while it changes. The Tint colors are mixed by how much of each effect there is; a Scale and a Rotate go that part of the way each, the sizes multiplying and the turns adding. A Wobble, a Distort, a Blocks and a See-through cannot be mixed (a picture has only one of each, and the screen has one block size and one see-through level), so the old effect fades out in the first half of the change and the new one fades in during the second half. Calling it again in the middle of a change starts from what is showing, so nothing jumps; up to three effects can be on their way at once, and a fourth drops the one that is nearly gone. In a Draw event it changes the effect that dresses the pictures drawn between sprite_effect_start and sprite_effect_stop. An object that changes uses one place of the 8 that sprite effects have, however many effects are on their way. A game that never calls it has none of this in its cartridge.